package net.minecraft.src;

import java.util.Random;

public class BlockPrehistoricWood extends Block
{

	public BlockPrehistoricWood(int i, int j)
	{
		super(i, j, Material.wood);
		blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/pph/wood.png");
		calamitesTexture = ModLoader.addOverride("/terrain.png", "pph/calamiteswood.png");
		sigillariaTexture = ModLoader.addOverride("/terrain.png", "pph/sigillariawood.png");
	}
	
	public int getBlockTextureFromSideAndMetadata(int i, int j)
	{
	    if(i == 0 || i == 1)
	    {
	        return 21;
	    } 
		if(j == 1)
		{
			return calamitesTexture;
		}
		if(j == 3)
		{
			return sigillariaTexture;
		} else
	    {
	        return blockIndexInTexture;
	    }
	}

    public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
    {
        super.harvestBlock(world, entityplayer, i, j, k, l);
    }

    public void onBlockRemoval(World world, int i, int j, int k)
    {
        byte byte0 = 4;
        int l = byte0 + 1;
        if(world.checkChunksExist(i - l, j - l, k - l, i + l, j + l, k + l))
        {
            for(int i1 = -byte0; i1 <= byte0; i1++)
            {
                for(int j1 = -byte0; j1 <= byte0; j1++)
                {
                    for(int k1 = -byte0; k1 <= byte0; k1++)
                    {
                        int l1 = world.getBlockId(i + i1, j + j1, k + k1);
                        if(l1 != Block.leaves.blockID)
                        {
                            continue;
                        }
                        int i2 = world.getBlockMetadata(i + i1, j + j1, k + k1);
                        if((i2 & 8) == 0)
                        {
                            world.setBlockMetadata(i + i1, j + j1, k + k1, i2 | 8);
                        }
                    }

                }

            }

        }
    }

    protected int damageDropped(int i)
    {
        return i;
    }
	
	private int calamitesTexture;
	private int sigillariaTexture;
}
